//
//  FTBaseCell.m
//  WebPDA
//
//  Created by Justin Yip on 8/15/10.
//  Copyright 2010 TenNights.com. All rights reserved.
//

#import "FTBaseCell.h"


@implementation FTBaseCell
@synthesize formBundle;
@synthesize preferenceSpecifier;
@synthesize cellValueObserver;
@synthesize label;

-(void)configureWithEntity:(id)entity preferenceSpecifier:(NSDictionary*)ps {
	self.preferenceSpecifier = ps;
	NSString * title= [preferenceSpecifier objectForKey:@"Title"];
	label.text = NSLocalizedStringFromTableInBundle(title, @"Root", formBundle, @"");
}

-(id)initWithFormBundle:(NSBundle*)bundle valueObserver:(id)observer reuseIdentifier:(NSString *)reuseIdentifier {
    if ((self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier])) {
		//retain the bundle
		self.formBundle = bundle;
		self.cellValueObserver = observer;
        
		self.selectionStyle = UITableViewCellSelectionStyleNone;
		label = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 100, 25)];
		label.textAlignment = UITextAlignmentLeft;
		label.font = [UIFont boldSystemFontOfSize:14];
		[self.contentView addSubview:label];
    }
    return self;
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {

    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


- (void)dealloc {
	[formBundle release];
	[preferenceSpecifier release];
	[cellValueObserver release];
	[label release];
    [super dealloc];
}

- (void) didSelected:(UITableViewController *)tableViewController{

	
}

@end
